<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        /*1、封装一个输入半径求圆的面积的函数*/
        function square(r) {
             document.write(3.14*r*r);
        }
        var R = prompt("请输入一个半径","5");
        square(R);
    </script>
</body>
</html>